<template>
  <div class="commit">
    <header>
      <div class="top">
        <img src="../../../static/img/zuojiantou.png" alt="" @click="back">
        <span>评论管理</span>
      </div>
    </header>
    <div class="evaluation">
      <div class="evaluationNum">
        <div class="evaluationNum-left">
          <div class="mark">
            <p>4.7</p>
            <div>商家评分</div>
          </div>
          <div class="evaluationNumLeftStar">
            <div>
              <span>服务</span>
              <van-rate allow-half v-model="9.5/2" readonly color="#FFAA01" />
            </div>
            <div>
              <span>口味</span>
              <van-rate allow-half v-model="9.5/2" readonly color="#FFAA01" />
            </div>
            <div>
              <span>包装</span>
              <van-rate allow-half v-model="9.5/2" readonly color="#FFAA01" />
            </div>
          </div>
        </div>
        <div class="evaluationNum-right">
          <p>80%</p>
          <div>配送满意度</div>
        </div>
      </div>
      <div class="evaluation-tit1">用户评价</div>
      <div class="evaluation-content">
        <div class="evaluation-type">
          <p v-for="(x,y) in typeList" :class="showType==y?'evaluation-type-ped evaluation-type-p':'evaluation-type-p'" @click="showTypeCallBack(y)">{{x}}</p>
        </div>
        <div class="evaluation-items">
          <div class="comment-box">
            <div class="comment-box-top">
              <div class="comment-box-img">
                <img src="../../../static/img/uhead.jpg" alt="">
                <div class="comment-box-name">
                  <span>代码搬运工</span>
                  <div class="star">
                    <van-rate allow-half v-model="9.5/2" readonly color="#FF7005" />
                  </div>
                </div>
              </div>
              <div class="comment-box-time">
                <p>04-30 14:43</p>
                <p>口味5星/包装5星/配送满意</p>
              </div>
            </div>
            <div class="comment-box-info">
              这个蛋糕真的超级好吃，香甜细腻，这个味的真的不要太好
              吃！！一定要试试！！
            </div>
            <div class="comment-img">
              <img :src="`../../../static/img/es${x}.png`" alt="" v-for="x in [1,2,3,1,2,3]" :style="{marginRight:(x+1)%4==0?0:'.15rem'}">
            </div>
            <div class="commit_norms">
              <span>规格：</span>
              <span>10支装</span>
            </div>
            <div class="commit_input">
              <label>
                <img src="../../../static/img/tz2.png" alt="">
                <span>回复：</span>
                <input></input>
              </label>
              <div class="send">发送</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "commit",
    data(){
      return {
        typeList:['全部','未回复差评0','未回复4','好评18','中评0','中评2'],
        showType:0,
        thisComment:false // 当前是否点赞
      }
    },
    methods:{
      back() {
        this.$router.back();
      },
      format(percentage) {
        return percentage === 100 ? '已抢空' : `${percentage}%`;
      },
      showTypeCallBack(num){
        this.showType = num;
      }
    }
  }
</script>

<style scoped>
  .commit {
    width: 100%;
    box-sizing: border-box;
  }
  .commit header{
    width: 100%;
    height: 1.25rem;
    background: linear-gradient(170deg,rgba(251,68,72,1) 0%,rgba(254,111,77,1) 100%);
    color: #ffffff;
  }
  .commit header > div > img {
    width: .11rem;
    height: .18rem;
  }

  .commit header > div > span {
    font-size: .18rem;
    font-weight: 500;
    color: #ffffff;
    flex-grow: 1;
    text-align: center;
  }

  .commit header .top{
    height: .5rem;
    display: flex;
    align-items: center;
    padding: 0 .1rem;
  }
  .commit header .people div:nth-child(1){
    font-size: .24rem;
    font-weight: bold;
    padding-bottom: .05rem;
  }
  .commit .evaluation {
    padding: .15rem 0;
  }
  .commit .evaluationNum {
    /*width: calc(100% - .32rem);*/
    margin: -.9rem .13rem 0;
    padding: .18rem .16rem;
    background:rgba(255,255,255,1);
    box-shadow:0 .02rem 0.04rem 0 rgba(0, 0, 0, 0.08);
    border-radius:.02rem;
    display: flex;
    flex-flow: row;
    align-items: center;
  }
  .commit .evaluationNum-left {
    width: 70%;
    display: flex;
    flex-flow: row;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    flex-grow: 1;
  }
  .commit .evaluationNum-left .mark{
    margin-right: .3rem;
  }
  .commit .evaluationNum-left .mark>p{
    font-size:.4rem;
    font-family:PingFang SC;
    font-weight:800;
    color: #FB4448;
  }
  .commit .evaluationNum-left .mark>div{
    font-family:PingFang SC;
    font-size:.12rem;
    color: #666666;
    text-align: center;
  }
  .commit .evaluationNum-left .evaluationNumLeftStar{
    flex-grow: 1;
  }
  .commit .evaluationNum-left .evaluationNumLeftStar>div{
    display: flex;
    align-items: center;
    margin-bottom: .02rem;
  }
  .commit .evaluationNum-left .evaluationNumLeftStar>div>span {
    font-size:.12rem;
    font-family:PingFang SC;
    font-weight:500;
    margin-right: .16rem;
    color: #333333;
  }
  .commit .evaluationNum-right {
    width: 20%;
    height: .54rem;
    display: flex;
    flex-flow: column;
  }
  .commit .evaluationNum-right>div {
    display: flex;
    flex-flow: row;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size:.12rem;
    margin-top: .08rem;
  }
  .commit .evaluationNum-right>p {
    font-size:.2rem;
    font-family:PingFang SC;
    font-weight:500;
    color: #999999;
    margin-right: .05rem;
    text-align: center;
  }
  .commit .evaluation-tit1 {
    padding: 0 .15rem;
    height: .5rem;
    line-height: .5rem;
    font-size:.18rem;
    font-family:PingFang SC;
    font-weight:800;
    color:rgba(51,51,51,1);
  }

  .commit .evaluation-content {
    background-color: #F5F5F5;
  }
  .commit .evaluation-type {
    background-color: #FFFFFF;
    padding: .1rem .15rem;
    display: flex;
    flex-flow: row;
    align-content: center;
    flex-wrap: wrap;
  }
  .commit .evaluation-type-p {
    padding: 0 .13rem;
    height:.25rem;
    text-align: center;
    font-size:.12rem;
    font-family:PingFang SC;
    font-weight:500;
    line-height: .25rem;
    color: #999999;
    background-color: #F3F3F4;
    margin-right: .1rem;
    margin-bottom: .1rem;
  }
  .commit .evaluation-type-ped {
    background-color: #FB4448;
    color: #FFFFFF;
  }
  .commit .comment-box {
    background-color: #FFFFFF;
    padding: .15rem .15rem 0;
    margin-bottom: .1rem;
  }
  .commit .comment-box-top {
    display: flex;
    flex-flow: row;
    align-items: center;
    justify-content: space-between;
  }
  .commit .comment-box-img {
    display: flex;
    flex-flow: row;
    align-items: center;
  }
  .commit .comment-box-img>img {
    width: .35rem;
    height: .35rem;
    border-radius: 50%;
    margin-right: .13rem;
  }
  .commit .comment-box-name {
    height: .35rem;
    display: flex;
    flex-flow: column;
    justify-content: space-between;
  }
  .commit .comment-box-name>span {
    font-size:.14rem;
    font-family:PingFang SC;
    font-weight:bold;
    color: #4E4E4E;
  }
  .commit .comment-box-name>.star {
    margin: 0;
  }
  .commit .comment-box-time {
    display: flex;
    flex-flow: column;
    justify-content: space-between;
  }
  .commit .comment-box-time>p {
    text-align: right;
    font-size:.12rem;
    font-family:PingFang SC;
    font-weight:500;
    color: #B5B5B5;
  }
  .commit .comment-box-info {
    font-size:.13rem;
    font-family:PingFang SC;
    font-weight:500;
    color:rgba(98,98,98,1);
    line-height:.2rem;
    margin: .15rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
  }
  .commit .comment-img {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
  }
  .commit .comment-img>img {
    width: 1rem;
    height: .7rem;
    margin-right: .15rem;
    margin-bottom: .1rem;
  }
  .commit .commit_norms{
    font-size: .13rem;
    color: #999999;
  }
  .commit .commit_input{
    position: relative;
    background: #F6F6F6;
    height: .32rem;
    padding: 0 .08rem;
    border-radius: .04rem;
    margin-top: .05rem;
  }
  .commit .commit_input label{
    display: flex;
    align-items: center;
    height: 100%;
  }
  .commit .commit_input span{
    color: #999999;
  }
  .commit .commit_input img{
    width: .13rem;
    height: .13rem;
    margin-right: .04rem;
  }
  .commit .commit_input input{
    background: none;
    border: none;
    height: 100%;
  }
  .commit .commit_input .send{
    position: absolute;
    right: 0;
    top: 0;
    font-size: .15rem;
    color: #ffffff;
    text-align: center;
    background: #FB4448;
    height: .32rem;
    line-height: .32rem;
    width: .64rem;
    border-radius: .04rem;
  }


  /* 评分适配 */
  >>> .van-rate__icon {
    font-size: .11rem;
  }
  >>> .van-rate__item:not(:last-child) {
    padding-right: .04rem;
  }

  /* 进度条适配 */
  /deep/ .el-progress-bar__outer {
    background-color: #EBEBEB !important;
    border-radius: 1rem;
    height: .06rem !important;
  }
  >>> .el-progress-bar__inner {
    border-radius: 1rem;
  }
  /deep/ .el-progress-bar {
    width: 92%;
    padding-right: .2rem;
    margin-right: -.55rem;
  }
  /deep/ .el-progress__text {
    font-size:.1rem !important;
    color: #999999;
    font-family:PingFang SC;
    font-weight:400;
    margin-left: .4rem;
  }
</style>
